package com.wn.controller;

import com.wn.annotation.RequireRoles;
import com.wn.entity.Log;
import com.wn.service.LogService;
import com.wn.utils.PageParam;
import com.wn.utils.Rsp;
import com.wn.utils.SystemControllerLog;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("log")
public class LogController {

    @Resource
    private LogService logService;

    /**
     *分页查询订单数据
     *
     * @return 单条数据
     */
    @SystemControllerLog(description = "分页查询日志信息")
    @PostMapping("searchSomeLogByPage")
    @ApiOperation("查询所有 支持 多条件 分页 排序 查询")
    @RequireRoles(roles = {"admin","super_admin","reception","guide"},index = 1)
    public Rsp searchSomeLogByPage(@RequestBody PageParam<Log> pageParam,
                                     @RequestHeader("token") String token)
    {
        System.out.println(pageParam);
        return Rsp.success(logService.searchSomeLogrByPage(pageParam));

    }


}
